﻿<navigation:Page
    x:Class="ibba.src.norisk.PageProdutoModalidade"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:src="clr-namespace:ibba.src.norisk"
			 xmlns:slc="clr-namespace:ibba.src.slcomponentes;assembly=ibba.src.slcomponentes"
             xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 mc:Ignorable="d" Background="#FFFBFBFB" 
             Title="Produto / Modalidade">

    <UserControl.Resources>
        <src:ConverterUsaProcessamento x:Key="BackgroundUP" />
    </UserControl.Resources>


    <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" 
            VerticalAlignment="Stretch" Background="#FFFFFFFF" Margin="0,0,0,0" >

        <toolkit:BusyIndicator x:Name="activity">
            <Grid>

                <Grid.RowDefinitions >
                    <RowDefinition Height="52" />
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="0.75*"/>
                    <RowDefinition Height="0.25*"/>
                </Grid.RowDefinitions>

                <Grid  Grid.Row="0" 
		       Background="#FFFFFFFF" HorizontalAlignment="Stretch" VerticalAlignment="Top" >
                    <Grid.ColumnDefinitions >
                        <ColumnDefinition Width="240" />
                        <ColumnDefinition Width="253"/>

                        <ColumnDefinition Width="107"/>
                        <ColumnDefinition MinWidth="40" />

                    </Grid.ColumnDefinitions>

                    <Border Grid.Row="0" Background="#FF5C7590" Grid.ColumnSpan="5" HorizontalAlignment="Stretch" d:LayoutOverrides="GridBox">

                        <StackPanel Orientation="Horizontal" Width="160" Height="40" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Right">
                            <Image  Margin="0,0,0,0" Width="160" Height="40" Source="../image/etq_confidencial_restrita.png" />
                        </StackPanel>

                    </Border>
                    <Border Grid.Column="0" CornerRadius="10" Background="#FFDEDEDE" 
			Margin="15,6,0,0" Height="28" VerticalAlignment="Top"  >
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Height="28" Margin="0,0,7,0">
                            <TextBlock  Text="Buscar por" 
                                Foreground="#FF14517B" Margin="10,5,0,0"/>
                            <ComboBox x:Name="cboTipoPesquisa" Grid.Column="1" 
                              Margin="8,2,0,2" Width="140" Height="24"
                              SelectionChanged="cboTipoPesquisa_SelectionChanged"
                              />
                        </StackPanel>
                    </Border>

                    <sdk:AutoCompleteBox  x:Name="txtPesquisa" 
                                           Grid.Column="1" 
                                           FontSize="14" 
                                           IsTabStop="True"
                                           KeyUp="txtPesquisa_KeyDown"
                                           Margin="5,6,6,0" VerticalAlignment="Top" Height="26" />
                    <Button x:Name="btnPesquisarGrupo" 
                    Grid.Column="2"  
					Margin="0,6,0,0" 
					Width="100" 
                    HorizontalAlignment="Left"
                    Click="btnPesquisar_Click" VerticalAlignment="Top" Height="28" >

                        <StackPanel Orientation="Vertical" Margin="-55,-3,-52,0" Width="100" Height="26">
                            <Image Source="../image/search.png" Width="20" 
							HorizontalAlignment="Left"
							Margin="5,4,0,7" />
                            <TextBlock Text="Pesquisar" Margin="35,-25,8,0" FontSize="12"/>
                        </StackPanel>
                    </Button>

                </Grid>

                <Grid  Grid.Row="2" Margin="7,0,7,7" Background="#FFFFFFFF" ShowGridLines="False">
                    <Grid.ColumnDefinitions >
                        <ColumnDefinition Width="650"/>
                        <ColumnDefinition Width="200"/>
                    </Grid.ColumnDefinitions>
                </Grid>
                <TextBlock 
        	Text="Parametrizações"
        	FontSize="14"
        	Foreground="#FFC4991C" 
        	VerticalAlignment="Top" Width="Auto" 
        	HorizontalAlignment="Left" FontFamily="Verdana" Grid.Row="2" Margin="8,8,0,0" 
				/>
                <sdk:DataGrid x:Name ="grdProduto" 
        	Margin="7,29,19,26" 
        	Grid.Column="0"
        	RenderTransformOrigin="0.5,0.5" 
        	Visibility="Visible" 
        	MinHeight="200" 
			MaxWidth="1200"
			HorizontalAlignment="Left"
        	Background="#00000000" 
        	AlternatingRowBackground="#FFFCFCFC" 
        	RowBackground="#FFFCFCFC" 
        	AutoGenerateColumns="False" 
        	IsReadOnly="True"
        	BorderBrush="#FFF8F8F8"
        	HorizontalScrollBarVisibility="Hidden" Grid.Row="2" d:LayoutOverrides="GridBox"
        				>
                    <sdk:DataGrid.Columns>
                        <sdk:DataGridTextColumn Header="Id" Width="1" Binding="{Binding Path=Id}" Visibility="Collapsed"/>

                        <sdk:DataGridTemplateColumn IsReadOnly="True" Header="Código Produto"  MinWidth="110" Width="140"  >
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Border Background="{Binding Path=UsaProcessamento, Converter={StaticResource BackgroundUP}}">
                                        <TextBlock Text="{Binding Path=CodigoProduto}" />
                                    </Border>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>

                        <sdk:DataGridTemplateColumn IsReadOnly="True" Header="Descrição Produto" MinWidth ="180" Width="340" >
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Border Background="{Binding Path=UsaProcessamento, Converter={StaticResource BackgroundUP}}">
                                        <TextBlock Text="{Binding Path=DescricaoProduto}" />
                                    </Border>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>

                        <sdk:DataGridTemplateColumn IsReadOnly="True" Header="Código Modalidade" MinWidth ="140"  Width="160">
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Border Background="{Binding Path=UsaProcessamento, Converter={StaticResource BackgroundUP}}">
                                        <TextBlock Text="{Binding Path=CodigoModalidade}" />
                                    </Border>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>

                        <sdk:DataGridTemplateColumn IsReadOnly="True" Header="Descrição Modalidade" MinWidth ="180" Width="340">
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Border Background="{Binding Path=UsaProcessamento, Converter={StaticResource BackgroundUP}}">
                                        <TextBlock Text="{Binding Path=DescricaoModalidade}" />
                                    </Border>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>

                        <sdk:DataGridTemplateColumn >
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Button x:Name="btnDetalhe" Click="btnDetalhe_Click">
                                        <StackPanel Orientation="Vertical" >
                                            <Image Source="../image/edit.png" 
        								Stretch="None" 
        								Width="16" 
        								Height="16"
                                            />
                                        </StackPanel>
                                    </Button>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                    </sdk:DataGrid.Columns>
                </sdk:DataGrid>

                <!--<slc:ControlMenuBar x:Name="barraMenu" Grid.Row="3" Height="85" VerticalAlignment="Bottom" TitleBar="Menu"
				User="[Usuario]" />-->

                <!--<src:PageDetalheProdutoModalidade  Name="DetalheProdutoModalidade"
                                       Visibility="Collapsed" 
                                       Grid.Row="0" Grid.RowSpan="4" 
                                              Width="auto" Height="auto" MinHeight="800" MinWidth="600"   
                                              HorizontalAlignment="Stretch" 
		                               VerticalAlignment="Stretch"  Grid.ColumnSpan="3"/>-->

            </Grid>
        </toolkit:BusyIndicator>
    </Grid>

</navigation:Page>